package org.springframework.ai.tool.resolution;

import org.springframework.ai.tool.execution.ToolCallResultConverter;
import org.springframework.lang.Nullable;

import java.lang.reflect.Type;

public class ToolCallResultConverterWrapper implements ToolCallResultConverter {

    private final ToolCallResultConverter delegate;
    private final Type returnType;

    public ToolCallResultConverterWrapper(ToolCallResultConverter delegate, Type returnType) {
        this.delegate = delegate;
        this.returnType = returnType;
    }

    @Override
    public String convert(@Nullable Object result, @Nullable Type returnType) {
        return delegate.convert(result, this.returnType);
    }
}
